import rospy
from sensor_msgs.msg import Range


def range_callback(msg):
    rospy.loginfo("Distance: %f", msg.range)


if __name__ == '__main__':
    rospy.init_node('range_subscriber')
    sub = rospy.Subscriber('distance_sensor', Range, range_callback)
    rospy.spin()
